<template>
  <el-dialog
    title="查看详情"
    :visible.sync="dialogVisible"
    width="80%"
    top="0"
    :before-close="cancelBtn"
  >
  <div v-html="editValue"></div>
  </el-dialog>
</template>

<script>
export default {
  name: "NewsDialog",
  props: {
    newsDialogFu: Boolean,
    editValueFu: [String, Boolean, Array, Object, Number]
  },
  data() {
    return {
      dialogVisible: false,
      editValue: null,
    };
  },
  methods: {
    // 取消,关闭弹框，修改父组件的值
    cancelBtn() {
      this.dialogVisible = false;
      this.$emit("closeDialog", this.dialogVisible);
    }
  },
  watch: {
    newsDialogFu(val) {
      this.dialogVisible = val;
    },
    editValueFu(val){
      this.editValue = val;
    }
  }
};
</script>

<style>
.el-dialog__header{
  border-bottom: 1px solid #666666;
}
p:nth-child(1){
  color: red;
}
p:nth-child(2){
  color: green;
}
</style>
